<template>
    <!-- 数据插槽 -->
    <el-row type="flex" justify="space-between" align="middle" style="height: 40px; width: 100%">
        <!-- 左侧数据 -->
        <el-col>{{treeNode.name}}</el-col>
        <!-- 右侧数据 -->
        <el-col :span="6">
            <el-row type="flex" justify="end">
                <!-- 右侧左边 -->
                <el-col class="right"></el-col>
                <!-- 右侧右边 -->
                <el-col>
                    <!-- 放置下拉菜单栏 -->
                    <el-dropdown @command="operateDepts">
                        <span>操作<i class="el-icon-arrow-down" /></span>
                        <el-dropdown-menu slot="dropdown" >
                            <el-dropdown-item command="add" >添加</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </el-col>
            </el-row>
        </el-col>
    </el-row>
</template>

<script>
    export default {
        props: {
            treeNode: {
                type: Object,
                require: true
            },
            isRoot: {
                type: Boolean,
                default: false
            }
        },
        data() {
            return {
                loading: false, // 进度条
                departs: [], // 属性架构数据
                node: null, // 当前点击节点

            }
        },
        methods:{
    operateDepts(type) {
      if (type === 'add') {
          console.log(this.treeNode)
        this.$emit('addDepts', this.treeNode)
        
      } else if (type === 'edit') {
      } else {
        this.$confirm('确定要删除吗').then(() => {
        }).then(() => {
          this.$message.success('删除成功')
        })
      }
    }
        }
    }
</script>

<style>

</style>
